<template>
  <el-table height="400" style="width: 100%" :data="courseData" >
    <el-table-column
        fixed="left"
        prop="courseID"
        label="科目号"></el-table-column>
    <el-table-column
        prop="courseName"
        label="科目名"></el-table-column>
    <el-table-column
        label="学时"
        prop="courseHour"></el-table-column>
    <el-table-column
        prop="classCycle"
        label="上课周期"></el-table-column>
    <el-table-column
        prop="Fee"
        label="收费"></el-table-column>
    <el-table-column
        prop="classLocation"
        label="上课地点"></el-table-column>
    <el-table-column
        prop="teacherID"
        label="教师号"></el-table-column>
    <el-table-column
        prop="classSize"
        label="招收人数"></el-table-column>
    <el-table-column
        prop="enrolledNumber"
        label="已报名人数"></el-table-column>
    <el-table-column
        label="修改"><el-button plain @click="">修改</el-button></el-table-column>
  </el-table>

  <el-button type="primary" @click="addCourse = true">新建课程</el-button>
  <el-button type="primary" @click="deleteCourse = true">删除课程</el-button>

  <add-course v-bind:visible="addCourse"></add-course>
  <delete-course v-bind:visible="deleteCourse"></delete-course>
</template>

<script>
import {ref} from "vue";
import AddCourse from "../components/AddCourseDialog.vue";
import DeleteCourse from "../components/DeleteCourseDialog.vue";
export default {
  name: "CourseManage",
  components: {DeleteCourse, AddCourse},
  setup() {
    let addCourse = ref(false);
    let deleteCourse = ref(false);
    return {
      courseData: [
        {
          courseID: 243645,
          courseName: "武术",
          courseHour: 48,
          classCycle: 12,
          Fee: 5000,
          classLocation: "f212",
          teacherID: 140678,
          classSize: 85,
          enrolledNumber:10,
        },
        {
          courseID: 243646,
          courseName: "油画",
          courseHour: 40,
          classCycle: 10,
          Fee: 4000,
          classLocation: "f219",
          teacherID: 1403465,
          classSize: 80,
          enrolledNumber:19,
        },
        {
          courseID: 243647,
          courseName: "书法",
          courseHour: 39,
          classCycle: 7,
          Fee: 3000,
          classLocation: "f312",
          teacherID: 144675,
          classSize: 67,
          enrolledNumber:20,
        },
        {
          courseID: 243648,
          courseName: "街舞",
          courseHour: 70,
          classCycle: 12,
          Fee: 5500,
          classLocation: "e408",
          teacherID: 143678,
          classSize: 75,
          enrolledNumber:60,
        },
        {
          courseID: 243649,
          courseName: "迪斯科",
          courseHour: 66,
          classCycle: 10,
          Fee: 4500,
          classLocation: "T469",
          teacherID: 234404,
          classSize: 49,
          enrolledNumber:10,
        }
      ],
      addCourse,
      deleteCourse,
    }
  }
}
</script>

<style scoped>

</style>